import {defineStore} from "pinia";
import {ref, type Ref, type UnwrapRef} from 'vue'
import {ArticleProfileDto} from "../dto/ArticleProfileDto";


export const articleProfileStore = defineStore("articleProfile",
    () => {

        const store: Ref<UnwrapRef<Map<Number, ArticleProfileDto>>> = ref(new Map<Number, ArticleProfileDto>());


        function get(id: number): ArticleProfileDto | undefined {

            return store.value.get(id);
        }

        function set(id: number, value: ArticleProfileDto) {
            store.value.set(id, value);
        }

        return {store,get,set}


    })